/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package models;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Eduardo
 */
@Entity
@Table(name = "Infraestructura_Fisica")
@NamedQueries({
    @NamedQuery(name = "InfraestructuraFisica.findAll", query = "SELECT i FROM InfraestructuraFisica i"),
    @NamedQuery(name = "InfraestructuraFisica.findByIdInfraestructura", query = "SELECT i FROM InfraestructuraFisica i WHERE i.idInfraestructura = :idInfraestructura"),
    @NamedQuery(name = "InfraestructuraFisica.findByEstado", query = "SELECT i FROM InfraestructuraFisica i WHERE i.estado = :estado"),
    @NamedQuery(name = "InfraestructuraFisica.findByCantidad", query = "SELECT i FROM InfraestructuraFisica i WHERE i.cantidad = :cantidad")})
public class InfraestructuraFisica implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "IdInfraestructura")
    private Integer idInfraestructura;
    @Column(name = "Estado")
    private Integer estado;
    @Column(name = "Cantidad")
    private Integer cantidad;
    @JoinColumn(name = "IdTipoInfraestructura", referencedColumnName = "IdTipoInfraestructura")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private TipoInfraestructuraFisica idTipoInfraestructura;
    @JoinColumn(name = "IdZona", referencedColumnName = "IdZona")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Zona idZona;

    public InfraestructuraFisica() {
    }

    public InfraestructuraFisica(Integer idInfraestructura) {
        this.idInfraestructura = idInfraestructura;
    }

    public Integer getIdInfraestructura() {
        return idInfraestructura;
    }

    public void setIdInfraestructura(Integer idInfraestructura) {
        this.idInfraestructura = idInfraestructura;
    }

    public Integer getEstado() {
        return estado;
    }

    public void setEstado(Integer estado) {
        this.estado = estado;
    }

    public Integer getCantidad() {
        return cantidad;
    }

    public void setCantidad(Integer cantidad) {
        this.cantidad = cantidad;
    }

    public TipoInfraestructuraFisica getIdTipoInfraestructura() {
        return idTipoInfraestructura;
    }

    public void setIdTipoInfraestructura(TipoInfraestructuraFisica idTipoInfraestructura) {
        this.idTipoInfraestructura = idTipoInfraestructura;
    }

    public Zona getIdZona() {
        return idZona;
    }

    public void setIdZona(Zona idZona) {
        this.idZona = idZona;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idInfraestructura != null ? idInfraestructura.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InfraestructuraFisica)) {
            return false;
        }
        InfraestructuraFisica other = (InfraestructuraFisica) object;
        if ((this.idInfraestructura == null && other.idInfraestructura != null) || (this.idInfraestructura != null && !this.idInfraestructura.equals(other.idInfraestructura))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "models.InfraestructuraFisica[ idInfraestructura=" + idInfraestructura + " ]";
    }
    
}
